/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kmcsoft.goldshop.model.master;

import com.kmcsoft.emaster.entity.TrackableEntity;
import com.kmcsoft.goldshop.model.exchange.DiamondExchangeDetail;
import java.util.ArrayList;
import java.util.List;
import javax.jdo.annotations.FetchGroup;
import javax.jdo.annotations.FetchGroups;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;

/**
 *
 * @author kmcsoft02
 */
@PersistenceCapable(detachable = "true", table = "SHOP_DiamondGroup")
@FetchGroups(value = {
@FetchGroup(name = "detach_DiamondGroup_Unit", members = {
    @Persistent(name = "unit")}),
@FetchGroup(name = "detach_DiamondGroup_ProductDiamond", members = {
    @Persistent(name = "diamonds")}),
@FetchGroup(name = "detach_DiamondGroup_DiamondExchange", members = {
    @Persistent(name = "exchanges")})
})
public class DiamondGroup extends TrackableEntity {

    @Persistent
    private String name;
    @Persistent
    private double size;
    @Persistent
    private Unit unit;
    @Persistent
    private String note;
    @Persistent(mappedBy="diamondGroup")
    private List<ProductDiamond> diamonds;
    @Persistent(mappedBy="diamondGroup")
    private List<DiamondExchangeDetail> exchanges ;

    public DiamondGroup() {
        diamonds = new ArrayList<ProductDiamond>();
        exchanges = new ArrayList<DiamondExchangeDetail>();
    }
    
    
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getSize() {
        return size;
    }

    public void setSize(double size) {
        this.size = size;
    }

    public Unit getUnit() {
        return unit;
    }

    public void setUnit(Unit unit) {
        this.unit = unit;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public List<ProductDiamond> getDiamonds() {
        return diamonds;
    }

    public void setDiamonds(List<ProductDiamond> diamonds) {
        this.diamonds = diamonds;
    }

    public List<DiamondExchangeDetail> getExchanges() {
        return exchanges;
    }

    public void setExchanges(List<DiamondExchangeDetail> exchanges) {
        this.exchanges = exchanges;
    }
    
}
